Added a hotplug KOBJ_OFFLINE call, for symmetry with the ONLINE call used here.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 23 Nov 2005 18:45:57 +0000 (18:45 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Wed, 23 Nov 2005 18:45:57 +0000 (18:45 +0000)
We need a hook to be able to close down the device properly, but the REMOVE
event is no good because we don't get the script and vif environment variables
set in that case.

Closes bug #417.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
linux-2.6-xen-sparse/drivers/xen/netback/xenbus.c

index 950dfa8f8cb493ac9af6d543ab961c7887bc5cf1..086c2ec5fb269a1ece6ab9aa7495a0e8a7b2c85e 100644 (file)
@@ -216,13 +216,14 @@ static void frontend_changed(struct xenbus_device *dev,
                break;
 
        case XenbusStateClosed:
-               device_unregister(&be->dev->dev);
+               kobject_hotplug(&dev->dev.kobj, KOBJ_OFFLINE);
+               device_unregister(&dev->dev);
                break;
 
        case XenbusStateUnknown:
        case XenbusStateInitWait:
        default:
-               xenbus_dev_fatal(be->dev, -EINVAL, "saw state %d at frontend",
+               xenbus_dev_fatal(dev, -EINVAL, "saw state %d at frontend",
                                 frontend_state);
                break;
        }